package com.punai.customer.mapper;

import com.punai.common.core.mapper.CommonMapper;
import com.punai.customer.domain.CusGxChapter;
import com.punai.customer.domain.vo.CusAllVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 工序分包费用项章节Mapper接口
 *
 * @author zxw
 * @date 2022-12-09
 */
public interface CusGxChapterMapper extends CommonMapper<CusGxChapter>
{
    /**
     * 查询工序分包费用项章节
     *
     * @param id 工序分包费用项章节主键
     * @return 工序分包费用项章节
     */
    public CusGxChapter selectDmcGxChapterById(String id);

    /**
     * 查询工序分包费用项章节列表
     *
     * @param dmcGxChapter 工序分包费用项章节
     * @return 工序分包费用项章节集合
     */
    public List<CusGxChapter> selectDmcGxChapterList(CusGxChapter dmcGxChapter);

    /**
     * 批量删除工序分包费用项章节
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteDmcGxChapterByIds(@Param("ids")List<String> ids,@Param("companyId") Long companyId);

    List<CusGxChapter> selectChildrenById(@Param("chapterId") String chapterId, @Param("companyId") Long companyId);

    List<String> selectChildrenIdById(@Param("chapterId") String chapterId, @Param("companyId") Long companyId);

    List<CusGxChapter> selectListByTopId(@Param("topId") String topId, @Param("companyId") Long companyId);

    public List<CusGxChapter> queryContrast(@Param("companyId")Long companyId, @Param("ids") String[] ids);

    public List<CusAllVo> countNode(@Param("companyId")Long companyId);

    List<String> selectSpecIdAll(@Param("companyId")Long companyId);

    void insertChapter(@Param("companyId") Long companyId,@Param("specId") String specId,@Param("userId") Long userId,@Param("deptId") Long deptId,@Param("createBy") String createBy);

    Integer maxOrderNum(@Param("pid") String pid, @Param("companyId") Long companyId);

    void orderNumProcess(@Param("companyId") Long companyId, @Param("pid") String pid,
                         @Param("orderNum") Integer orderNum,@Param("num") int num);

    void orderNumProcessStartEnd(@Param("companyId")Long companyId,@Param("pid")  String pid,
                                 @Param("startNum")int startNum, @Param("endNum") int endNum,
                                 @Param("num") int num);

    void updateChildrenPids(@Param("childrenList") List<CusGxChapter> children, @Param("companyId")Long companyId);

    String getChildMaxLengthPids(@Param("id") String id, @Param("companyId") Long companyId);


    String getFeatureListById(@Param("id") String id,@Param("companyId") Long companyId,@Param("splitFlag") String splitFlag);
}
